
//
// https://ourcodeworld.com/articles/read/278/how-to-split-an-array-into-chunks-of-the-same-size-easily-in-javascript
//


interface Array<T> {
  chunk(chunkSize: number): Array<Array<T>>;
}

Array.prototype.chunk = function(chunkSize: number) {
  let temporal = [];
  for (let i = 0; i < this.length; i += chunkSize) {
    temporal.push(this.slice(i, i + chunkSize));
  }
  return temporal;
};


